import { Injectable } from '@nestjs/common';
import { CreateRecordCompanyDto } from './dto/create-record_company.dto';
import { UpdateRecordCompanyDto } from './dto/update-record_company.dto';
import { InjectRepository } from '@nestjs/typeorm';
import { RecordCompanyEntity } from './entities/record_company.entity';
import { Repository } from 'typeorm';

@Injectable()
export class RecordCompanyService {
  constructor(
    @InjectRepository(RecordCompanyEntity)
    private readonly recordCompanyRepository: Repository<RecordCompanyEntity>,
  ) {}
  create(createRecordCompanyDto: CreateRecordCompanyDto) {
    return 'This action adds a new recordCompany';
  }

  findAll() {
    const qb = this.recordCompanyRepository.createQueryBuilder();
    qb.orderBy('create_time', 'DESC');
    return qb.getMany();
  }

  findOne(id: number) {
    return `This action returns a #${id} recordCompany`;
  }

  // update(id: number, updateRecordCompanyDto: UpdateRecordCompanyDto) {
  //   return `This action updates a #${id} recordCompany`;
  // }

  // remove(id: number) {
  //   return `This action removes a #${id} recordCompany`;
  // }
}
